package com.nothingboard.module.member.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.nothingboard.module.member.dao.MemberDao;
import com.nothingboard.module.member.model.MemberLogonDto;
import com.nothingboard.module.member.model.MemberSearchDto;
import com.nothingboard.module.member.model.MemberVo;

@Repository("memberDao")
public class MemberDaoImpl extends SqlMapClientDaoSupport implements MemberDao {
	
	@Resource(name="sqlMapClient") 
    public void setSuperSqlMapClient(SqlMapClient client){ 
        super.setSqlMapClient(client); 
    }

	@Override
	public Object getMemberByUsrId(MemberLogonDto dto) throws DataAccessException {
		return getSqlMapClientTemplate().queryForObject("member.getLoginMemberByUsrId", dto);
	}

	@Override
	public Object getMember(MemberSearchDto dto) throws DataAccessException {
		return getSqlMapClientTemplate().queryForObject("member.getMember", dto);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Object> getMemberList(MemberSearchDto dto) throws DataAccessException {
		return getSqlMapClientTemplate().queryForList("member.getMemberList", dto);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Object> getExpandValueList(MemberSearchDto dto) throws DataAccessException {
		return getSqlMapClientTemplate().queryForList("member.getExpandValueList", dto);
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public List<Object> getExpandItemList(MemberSearchDto dto) throws DataAccessException {
		return getSqlMapClientTemplate().queryForList("member.getExpandItemList", dto);
	}

	@Override
	public Object insert(MemberVo vo) throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int update(MemberVo vo) throws DataAccessException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public MemberVo get(int usrNo) throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}
	
}
